<nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark">
  <a class="navbar-brand" href="#">Node Demo</a>
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>

  <div class="collapse navbar-collapse" id="navbarsExampleDefault">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item active">
        <a class="nav-link" href="/index">首页 <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Link</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>

    </ul>
    <form class="form-inline my-2 my-lg-0">
      <input class="form-control mr-sm-2" type="text" placeholder="Search" aria-label="Search">
      <button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
    </form>

    {{ if user }}
    <div class="dropdown navbar-nav">
      <button class="btn btn-default dropdown-toggle nav-link" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
        {{ user.nikename }}
        <span class="caret"></span>
      </button>
      <ul class="dropdown-menu" aria-labelledby="dropdownMenu2">
        <!--<li><a href="#">Action</a></li>-->
        <!--<li><a href="#">Another action</a></li>-->
        <!--<li><a href="#">Something else here</a></li>-->
        <!--<li role="separator" class="divider"></li>-->
        <li><a class="" href="loginout">退出</a></li>
      </ul>
    </div>
    {{ else }}
    <ul class="navbar-nav">
      <li class="nav-item">
        <a class="nav-link" href="/register">注册</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="/login">登录</a>
      </li>
    </ul>
    {{/if}}

  </div>
</nav>
